package chapter3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-27 下午2:55
 */
public class TestDemo {
    public static void main(String[] args) {
        String label = "file1";
        String sub = label.substring(4);

        Message msg = new Message(20);
        fun(msg);
        System.out.println(msg.getNum());

        String original = "original";
        fun(original);
        System.out.println(original);

        int o = 29;
        fun(o);
        System.out.println(o);

        StringBuilder builder = new StringBuilder("org");
        fun(builder);
        System.out.println(builder.toString());
    }

    public static void fun(Message msg) {
        msg.setNum(100);
    }

    public static void fun(String temp) {
        temp = "changed";
    }

    public static void fun(int temp) {
        temp = 100;
    }

    public static void fun(StringBuilder builder) {
        builder.append("_new");
    }
}
